﻿namespace OasisCiq.Xpil
{
    using System;
    using System.Linq;

    /// <summary>
    /// List of information types used for describing a visa
    /// </summary>
    public class VisaElementList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[] 
        {
            "Type", // Type of visa. e.g. Tourist, Visitor, Student
            "Number",
            "Code", // Some visas are known by its code number. e.g. B1, E3, H-1, Class X1
            "Country", // Name of the country for which the visa is issued to.
            "IssuePlace", // Free text description of the issuing place, e.g. country name and office name or country name and the city. For example US Embassy, Prague, Australia, Sydney
            "MaximumStay", // Free text description of the length of maximum stay. E.g. 1 week, 2 months, etc.
            "Restriction", // Any restrictions imposed on the visa holder, e.g. not for employment, cannot work for more than 20 hours
            "Privilege", // Any privileges granted to the visa holder, e.g. departure fee waived, etc.
            "SpecialCondition", // Any special conditions imposed on the visa holder. e.g. Not allowed to work for more than 10 hours a week.
            "EntryType" // Single Entry, Multiple Entry, Double Entry, etc
        };

        public VisaElementList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}